<!DOCTYPE html>
<html>
<!-- 作者黄萌 -->

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>猫眼电影后台管理系统</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    

</head>

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">猫眼电影后台管理系统</div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="./login.html" id="userName">
                        登录
                    </a>

                </li>
                <li class="layui-nav-item">
                    <a href="" id="loginOut">退出</a>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a target="iframeMain" href="./otherPages/user/index.html"> 用户管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="iframeMain" href="./otherPages/movie/index.html">电影管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="iframeMain" href="./otherPages/cinema/index.html">院线管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="iframeMain" href="./otherPages/article/index.html">文章管理</a>
                    </li>
                      
                </ul>
            </div>
        </div>
        <div class="layui-body">
            <!-- 内容主体区域 -->
            <iframe src="" name="iframeMain" id="iframeMain" frameborder="0" style="width:100%;height:100%;"></iframe>
        </div>
    </div>
    <script src="./layui/layui.js"></script>
    <script src="./js/jquery-1.12.4.min.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/js.cookie.js"></script>

    <!-- JavaScript代码区域 -->
    <!-- 作者：黄佳 -->
    <script> 
        const mobile = localStorage.getItem("mobile");
        if (mobile) {
            $("#userName").text(mobile);
        } else {
            //登录失败
            layui.use("layer", function () {
                layui.layer.msg("请先登录！", {
                    icon: 2,
                    time: 1000,
                    end: function () {
                        location.href = "./login.html";
                    }
                })
            })
        }
        //退出事件
        $("#loginOut").click(function () {
            localStorage.removeItem("mobile")
        })
    </script>
</body>

</html>